Skip to content

Update tsconfig for Node 20 #10403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 13, 2025
Merged

Update tsconfig for Node 20 #10403

merged 2 commits into from
Aug 13, 2025

Conversation

eddeee888
Copy link
Collaborator

Description

This is based on https://github.com/tsconfig/bases/blob/main/bases/node20.json

Note:

  • bob has mapping to es2022 when building for ESM, so we cannot set module or moduleResolution like the base Node 20 example

Related #10218

Copy link

changeset-bot bot commented Aug 12, 2025

⚠️ No Changeset found

Latest commit: d306688

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -1,6 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: process.versions.node.split('.')[0] } }],
'@babel/preset-typescript',
['@babel/preset-typescript', { allowDeclareFields: true }],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use babel-jest, so we need this to understand declare keyword needed by tsconfig version of Node 20

@@ -691,7 +691,7 @@ export class BaseResolversVisitor<
TRawConfig extends RawResolversConfig = RawResolversConfig,
TPluginConfig extends ParsedResolversConfig = ParsedResolversConfig
> extends BaseVisitor<TRawConfig, TPluginConfig> {
protected _parsedConfig: TPluginConfig;
protected declare _parsedConfig: TPluginConfig;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, declare keyword, TS will throw error:

Property '_parsedConfig' will overwrite the base property in 'BaseVisitor<TRawConfig, TPluginConfig>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.ts(2612)

@eddeee888 eddeee888 merged commit 63ac348 into federation-fixes Aug 13, 2025
15 checks passed
@eddeee888 eddeee888 deleted the update-ts-config branch August 13, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant